<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="../../css/mui.min.css">
		<link rel="stylesheet" href="../../css/mui.picker.min.css" />
		<link rel="stylesheet" href="../../css/iconfont.css">
		<style>
			.mui-content-padded{margin:5px 0 0 0;}
			.mui-row-list span{float: left; line-height:33px; width:20%;}
			.mui-row-list select{float: left; line-height:14px; font-size:14px; margin-top:2px; margin-left: 5px;}
			.mui-btn-block{margin-bottom:0; padding:6px;}
			.mui-col-sm-12{ border-top: 1px solid #D1D1D1; width:100%; padding-top:5px; font-size:14px;}
			input[type="text"]{height:30px; margin-bottom: 5px;}
			input[readonly="readonly"]{ text-align: left; padding-left: 5px; padding-right: 0;}
			input{border-width: 0; height: 26px; float: right; text-align: right; padding-right: 15px;}
			form:before{ background: none !important; border: none !important;}
			.mui-switch:before {content: '否'; color: #999;}
			.mui-switch.mui-active:before {content: '是'; color: #fff;}
			.mui-switch.two:before {content: '正常'; color: #999;}
			.mui-switch.two.mui-active.two:before {content: '撤销'; color: #fff;}
			.mui-table-view-cell.mui-active{ display:block;}
			.border0{border-width: 0; border-bottom: #dddddd 1px solid;}
			.ui-alert{font-size: 14px;}
			#Popup {
				width: 0px;
				height: 0px;
				background: red;
				position: fixed;
				top: 70%;
				left: 50%;
			}
			.mui-popover{
				width: 300px;
			}
			.mui-popover .mui-popover-arrow:after {
				width: 0px;
			}
			.mui-switch{
				border-color: #fd933b;
				background-color: #fd933b;
				border-width: 1px;
			}
			.mui-switch:before {content: '选择'; color: #fff; right: 10px;}
			.mui-switch.mui-active:before {content: '填写'; color: #fff; left: 10px;}
			#mySwitch1{border-color: #007AFF; background-color: #007AFF;}
			#mySwitch1.mui-active {border-color: #fd933b; background-color: #fd933b;}
			#mySwitch1:before {content: '是'; color: #fff; right: 20px;}
			#mySwitch1.mui-active:before {content: '否'; color: #fff; left: 15px;}
			#mySwitch2{border-color: #007AFF; background-color: #007AFF;}
			#mySwitch2.mui-active {border-color: #fd933b; background-color: #fd933b;}
			#mySwitch2:before {content: '无'; color: #fff; right: 20px;}
			#mySwitch2.mui-active:before {content: '有'; color: #fff; left: 15px;}
			.mui-switch.mui-active {
				border-color: #007AFF;
				background-color: #007AFF;
			}
			.popover-cont ul{
				margin-top: 5px; 
				margin: 0; 
				padding: 0; 
				list-style: none; 
				background: #ffffff;
			}
			.table{
				width: 100%;
			}
			.thead{
				width: 100%;
				border: 1px solid #007AFF;
			}
			.thead tr{
				 width: 100%; 
				 background-color: #007AFF;
				 height: 20px;
			}
			.thead tr th{
				color: #ffffff;
				border-right: 1px solid #ffffff;
				text-align: center;
				font-family: "microsoft yahei";
				font-size: 14px;
				line-height: 20px;
			}
			.tbody{
				width: 100%;
				border: 1px solid #007AFF;
			}
			.tbody tr{
				 width: 100%; 
				 height: 20px;
			}
			.tbody tr td{
				color: #000;
				border: 1px solid #007AFF;
				text-align: center;
				font-family: "microsoft yahei";
				font-size: 14px;
				line-height: 20px;
			}
			.div-tab{
				width: 100%; 
				height: 200px; 
				overflow-y: scroll;
			}
			.div-tab::-webkit-scrollbar {
				display: none;
			}
			.submit{
				margin:0 auto 10px auto; 
				width:200px; 
				height:35px; 
				line-height: 35px; 
				background-color:#007AFF; 
				text-align: center; 
				color: #FFFFFF; 
				border-radius: 10px;
			}
			.mui-ul-check{ width: 100%; margin: 0; padding: 0;}
			.mui-ul-check li{float: left; list-style-type:none; text-align: center; padding:5px; margin:2px; border:1px solid #D1D1D1;}
			.mui-ul-check li.on{ background-color:#007AFF; color:#FFFFFF; float: left; list-style-type:none; text-align: center; padding:5px; margin:2px;}
		</style>
	</head>
	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title" id="high_id">精神病专档</h1>
		</header>
		<div class="mui-conten" style="margin-top:50px;">
			<ul class="mui-table-view">
				<div class="mui-row">
					<div class="mui-col-sm-12 mui-col-xs-12">
						<li class="mui-table-view-cell">
							<a style="float: left; font-size: 14px; width: 60px; line-height: 26px;">姓名</a>
							<input  id='name-1' name="name-1" class="ui-alert border0" readonly="readonly" placeholder="" style="width:70px; float: left;"/>
							<a style="float: left; font-size: 14px; width: 60px; line-height: 26px; margin-left: 5px;">性别</a>
							<input  id='sex-1' class="ui-alert border0" readonly="readonly" placeholder="" style="width:30px; float: left;"/>
							<a style="float: left; font-size: 14px; width: 60px; line-height: 26px; margin-left: 5px;">年龄</a>
							<input  id='age-1' class="ui-alert border0" readonly="readonly" placeholder="" style="width:40px; float: left;"/>
						</li>
						<li class="mui-table-view-cell">
							<a style="float: left; font-size: 14px; width: 90px; line-height: 26px;">家庭住址</a>
							<input  id='ad-1' class="ui-alert border0" readonly="readonly" placeholder="" style="width:210px; float: left;"/>
						</li>
					</div>
				</div>
			</ul>
			<ul class="mui-table-view" style="margin-top: 5px;">
				<div class="mui-row">
					<div class="mui-col-sm-12 mui-col-xs-12">
						<li class="mui-table-view-cell">
							<div style="float: left; font-size: 14px; width:120px; line-height: 26px;">患者监护人姓名</div>
							<input  id='hz_name' name="hz_name" class="ui-alert border0" class="ui-alert" style="width:50%;"/>
						</li>
						<li class="mui-table-view-cell">
							<a>
								<div style="float: left; font-size: 14px; width: 90px; line-height: 26px;">与患者关系</div>
								<input  id='Relationship' class="ui-alert border0"  placeholder="" style="float: right; width:50%;"/>
							</a>
						</li>
						<li class="mui-table-view-cell">
							<a data-options='{"type":"date"}'>
								<div style="float: left; font-size: 14px; width: 90px; line-height: 26px;">监护人地址</div>
								<input  id='address' class="ui-alert border0"  placeholder="" style="float: right; width:50%;"/>
							</a>
						</li>
						<li class="mui-table-view-cell">
							<a data-options='{"type":"date"}'>
								<div style="float: left; font-size: 14px; width: 90px; line-height: 26px;">监护人电话</div>
								<input  id='guardian_tel' class="ui-alert border0"  placeholder="" style="float: right; width:50%;"/>
							</a>
						</li>
						<li class="mui-table-view-cell">
							<a data-options='{"type":"date"}'>
								<div style="float: left; font-size: 14px; width: 90px; line-height: 26px;">辖区村(居)委会联系人</div>
								<input  id='Seat_contact' class="ui-alert border0"  placeholder="" style="float: right; width:50%;"/>
							</a>
						</li>
						<li class="mui-table-view-cell">
							<a data-options='{"type":"date"}'>
								<div style="float: left; font-size: 14px; width: 90px; line-height: 26px;">联系电话</div>
								<input  id='phone' class="ui-alert border0"  placeholder="" style="float: right; width:50%;"/>
							</a>
						</li>
					</div>
				</div>
			</ul>
			<ul class="mui-table-view" style="margin-top: 5px;">
				<div class="mui-row">
					<div class="mui-col-sm-12 mui-col-xs-12">
						<li class="mui-table-view-cell">
							<a class="btn mui-navigate-right">
								<div style="float: left; font-size: 14px; width: 90px; line-height: 26px;">户别</div>
								<input id="result0" name='Door_model' class="ui-alert"  placeholder="请选择" style="width:50%;"/>
							</a>
						</li>
					</div>
				</div>
			</ul>
			<ul class="mui-table-view" style="margin-top: 5px;">
				<div class="mui-row">
					<div class="mui-col-sm-12 mui-col-xs-12">
						<li class="mui-table-view-cell">
							<a data-options='{"type":"date"}' class="btn mui-navigate-right">
								<div style="float: left; font-size: 14px; width: 90px; line-height: 26px;">就业情况</div>
								<input id="result1" name='employment' class="ui-alert"  placeholder="请选择" style="width:50%;"/>
							</a>
						</li>
					</div>
				</div>
			</ul>
			<ul class="mui-table-view" style="margin-top: 5px;">
				<div class="mui-row">
					<div class="mui-col-sm-12 mui-col-xs-12">
						<li class="mui-table-view-cell">
							<div style="float: left; font-size:16px;">是否知情同意</div>
							<div class="mui-switch" id="mySwitch1">
							  <div class="mui-switch-handle"></div>
							</div>
						</li>
						<li class="mui-table-view-cell" id="qianzhi">
							<input class="ui-alert border0" id="qianzhi_t"  placeholder="请签名" style="float: left; width:150px; text-align: left;"/>
							<a data-options='{"type":"date"}' class="btn mui-navigate-right" style="float: right; font-size: 14px; width: 120px;">
								<input  id='result3' class="ui-alert"  placeholder="请选择时间" style="width:100%;"/>
							</a>
						</li>
						<li class="mui-table-view-cell">
							<a data-options='{"type":"date"}' class="btn mui-navigate-right">
								<div style="float: left; font-size: 14px; width: 90px; line-height: 26px;">首次发病时间</div>
								<input  id='result4' name="first_time" class="ui-alert"  placeholder="请选择" style="width:50%;"/>
							</a>
						</li>
					</div>
				</div>
			</ul>
			<div style="clear:both; font-size: 16px; line-height:25px; margin-left:15px; margin-top: 5px;">即往主要症状</div>
			<ul class="mui-table-view" style="margin-top: 5px;">
				<div class="mui-col-sm-12 mui-col-xs-12">
					<li class="mui-table-view-cell">
						<ul class="mui-ul-check" id="ularry">
							<li value="14">幻觉</li>
							<li value="15">交流困难</li>
							<li value="16">猜疑</li>
							<li value="17">息怒无常</li>
							<li value="18">行为怪异</li>
							<li value="19">兴奋话多</li>
							<li value="20">伤人毁物</li>
							<li value="21">悲观厌世</li>
							<li value="22">无故走出</li>
							<li value="23">自言自笑</li>
							<li value="24">孤僻懒散</li>
							<li value="482" id="other12">其他</li>
						</ul>
						<li class="mui-table-view-cell" style="display: none;" id="other12_op">
							<input id='other12_text' class="ui-alert bottom_soild"  placeholder="请输入其他症状" style="width:100%; float:right; margin-right:15px;"/>
						</li>
					</li>
				</div>
			</ul>
			
			<div style="clear:both; font-size: 16px; line-height:25px; margin-left:15px; margin-top: 5px;">即往治疗情况</div>
			<ul class="mui-table-view" style="margin-top: 5px;">
				<div class="mui-row">
					<div class="mui-col-sm-12 mui-col-xs-12">
						<li class="mui-table-view-cell">
							<a data-options='{"type":"date"}' class="btn mui-navigate-right">
								<div style="float: left; font-size: 14px; width:120px; line-height: 26px;">门诊</div>
								<input  id='result5' class="ui-alert"  placeholder="请选择" style="width:50%;"/>
							</a>
							<a data-options='{"type":"date"}' id="zhiliao" class="btn mui-navigate-right" style="display: none;">
								<div style="float: left; font-size: 14px; width:120px; line-height: 26px;">首抗精神病时间</div>
								<input  id='result6' class="ui-alert"  placeholder="请选择" style="width:50%;"/>
							</a>
							<a>
								<div style="float: left; font-size: 14px; width:100%; line-height: 26px;">住院（曾住精神专科医院/综合医院精神专科次数）</div>
								<a style="float: right; margin: 0 0 0 5px; padding: 0; line-height: 26px;">次</a>
								<input  id="in_hosp" class="ui-alert border0" style="float: right; padding: 0 10px; text-align: right;"  placeholder="请输入"/>
							</a>
						</li>
					</div>
				</div>
			</ul>
			
			<div style="clear:both; font-size: 16px; line-height:25px; margin-left:15px; margin-top: 5px;">目前诊断情况</div>
			<ul class="mui-table-view" style="margin-top: 5px;">
				<div class="mui-row">
					<div class="mui-col-sm-12 mui-col-xs-12">
						<li class="mui-table-view-cell">
							<div style="float: left; font-size: 14px; width:120px; line-height: 26px;">诊断</div>
							<input  id='diagnosis' class="ui-alert border0" class="ui-alert" style="width:50%;"/>
						</li>
						<li class="mui-table-view-cell">
							<a data-options='{"type":"date"}'>
								<div style="float: left; font-size: 14px; width: 90px; line-height: 26px;">确诊医院</div>
								<input  id='hosp' class="ui-alert border0"  placeholder="" style="float: right; width:50%;"/>
							</a>
						</li>
						<li class="mui-table-view-cell">
							<a data-options='{"type":"date"}' class="btn mui-navigate-right">
								<div style="float: left; font-size: 14px; width: 90px; line-height: 26px;">确诊时间</div>
								<input  id='result7' class="ui-alert"  placeholder="请选择" style="float: right; width:50%;"/>
							</a>
						</li>
					</div>
				</div>
			</ul>
			<ul class="mui-table-view" style="margin-top: 5px;">
				<div class="mui-row">
					<div class="mui-col-sm-12 mui-col-xs-12">
						<li class="mui-table-view-cell">
							<a data-options='{"type":"date"}' class="btn mui-navigate-right">
								<div style="float: left; font-size: 14px; width: 90px; line-height: 26px;">最近一次治疗效果</div>
								<input  id='result8' class="ui-alert"  placeholder="请选择" style="width:50%;"/>
							</a>
						</li>
						<li class="mui-table-view-cell">
							<div style="float: left; font-size:16px;">危险行为</div>
							<div class="mui-switch" id="mySwitch2">
							  <div class="mui-switch-handle"></div>
							</div>
						</li>
						<li class="mui-table-view-cell" style="display: none;" id="tigshow">
							<div class="dangerous" style="float: left; width: 100%; margin-top: 10px;">
								<div style="float: left; font-size: 14px; width:100px; line-height: 26px;">轻度滋事</div>
								<a style="float: right; margin: 0 0 0 5px; padding: 0; line-height: 26px; color: #bbb;">次</a>
								<input  id="dangerous1" class="ui-alert border0" style="float: right; padding: 0 10px; text-align: right;"  placeholder="请输入"/>
							</div>
							<div class="dangerous" style="float: left; width: 100%; margin-top: 10px;">
								<div style="float: left; font-size: 14px; width:100px; line-height: 26px;">肇事</div>
								<a style="float: right; margin: 0 0 0 5px; padding: 0; line-height: 26px; color: #bbb;">次</a>
								<input  id="dangerous2" class="ui-alert border0" style="float: right; padding: 0 10px; text-align: right;"  placeholder="请输入"/>
							</div>
							<div class="dangerous" style="float: left; width: 100%; margin-top: 10px;">
								<div style="float: left; font-size: 14px; width:100px; line-height: 26px;">肇祸</div>
								<a style="float: right; margin: 0 0 0 5px; padding: 0; line-height: 26px; color: #bbb;">次</a>
								<input  id="dangerous3" class="ui-alert border0" style="float: right; padding: 0 10px; text-align: right;"  placeholder="请输入"/>
							</div>
							<div class="dangerous" style="float: left; width: 100%; margin-top: 10px;">
								<div style="float: left; font-size: 14px; width:100px; line-height: 26px;">其它危险行为</div>
								<a style="float: right; margin: 0 0 0 5px; padding: 0; line-height: 26px; color: #bbb;">次</a>
								<input  id="dangerous4" class="ui-alert border0" style="float: right; padding: 0 10px; text-align: right;"  placeholder="请输入"/>
							</div>
							<div class="dangerous" style="float: left; width: 100%; margin-top: 10px;">
								<div style="float: left; font-size: 14px; width:100px; line-height: 26px;">自伤</div>
								<a style="float: right; margin: 0 0 0 5px; padding: 0; line-height: 26px; color: #bbb;">次</a>
								<input  id="dangerous5" class="ui-alert border0" style="float: right; padding: 0 10px; text-align: right;"  placeholder="请输入"/>
							</div>
							<div class="dangerous" style="float: left; width: 100%; margin-top: 10px;">
								<div style="float: left; font-size: 14px; width:100px; line-height: 26px;">自杀未遂</div>
								<a style="float: right; margin: 0 0 0 5px; padding: 0; line-height: 26px; color: #bbb;">次</a>
								<input  id="dangerous6" class="ui-alert border0" style="float: right; padding: 0 10px; text-align: right;"  placeholder="请输入"/>
							</div>
						</li>
						<li class="mui-table-view-cell">
							<a data-options='{"type":"date"}' class="btn mui-navigate-right">
								<div style="float: left; font-size: 14px; width: 90px; line-height: 26px;">关锁情况</div>
								<input  id='result10' class="ui-alert"  placeholder="请选择" style="width:50%;"/>
							</a>
						</li>
						<li class="mui-table-view-cell">
							<a data-options='{"type":"date"}' class="btn mui-navigate-right">
								<div style="float: left; font-size: 14px; width: 90px; line-height: 26px;">经济状况</div>
								<input  id='result11' class="ui-alert"  placeholder="请选择" style="width:50%;"/>
							</a>
						</li>
					</div>
				</div>
			</ul>
			<div style="clear:both; font-size: 16px; line-height:25px; margin-left:15px; margin-top: 5px;">专科医生的意见(如果有请记录)</div>
			<ul class="mui-table-view" style="margin-top: 5px;">
				<div class="mui-row">
					<div class="mui-col-sm-12 mui-col-xs-12">
						<li class="mui-table-view-cell">
							<input id="opinion" class="ui-alert"  placeholder="请填写" style="width:100%; text-align:left;"/>
						</li>
					</div>
				</div>
			</ul>
			<ul class="mui-table-view" style="margin-top: 5px;">
				<div class="mui-row">
					<div class="mui-col-sm-12 mui-col-xs-12">
						<li class="mui-table-view-cell">
							<div style="float: left; font-size: 14px; width:5rem; line-height: 26px;">随访频率</div>
							<a data-options='{"type":"date"}' class="btn mui-navigate-right" style="float: right; line-height: 26px;">
								<input  id='result12' name="frequency_date" class="ui-alert border0"  placeholder="请选择"  style="width:40px; float: left; padding-right: 5px;"/>
								/次
							</a>
							<input id="visitFrequency" class="ui-alert border0" style="float: right; width:5rem; text-align:right; padding-right: 5px; margin-right: 5px;" placeholder="随访频率"/>
						</li>
						<li class="mui-table-view-cell">
							<a data-options='{"type":"date"}' class="btn mui-navigate-right">
								<div style="float: left; font-size: 14px; width: 90px; line-height: 26px;">填表日期</div>
								<input  id='result13' name="Fill_date" class="ui-alert"  placeholder="请选择" style="float: right; width:50%;"/>
							</a>
						</li>
					</div>
				</div>
			</ul>
			<ul class="mui-table-view" style="margin-top: 5px;">
				<div class="mui-row">
					<div class="mui-col-sm-12 mui-col-xs-12">
						<li class="mui-table-view-cell">
							<div style="float: left; font-size:14px;">医生签名</div>
							<div class="mui-switch" id="mySwitch3">
							  <div class="mui-switch-handle"></div>
							</div>
						</li>
						<li class="mui-table-view-cell" id="tigshow_doc_1">
							<a data-options='{"type":"date"}' class="btn mui-navigate-right">
								<input id='result14' class="ui-alert"  placeholder="请选择" style="width:50%; text-align: right; float: right; padding-right: 15px;"/>
							</a>
						</li>
						<li class="mui-table-view-cell" style="display: none;" id="tigshow_doc_2">
							<div style="float: left; width:100%;">
								<div style="float: left; font-size: 16px; width:5rem; text-align:center;">医院</div>
								<input id='text-doc' class="ui-alert bottom_soild"  placeholder="请输入" style="width:60%; margin-left: 6px;"/>
							</div>
							<div style="float: left; width:100%;">
								<div style="float: left; font-size: 16px; width:5rem; text-align:center;">医生</div>
								<input id='text-hosp' class="ui-alert bottom_soild"  placeholder="请输入" style="width:60%; margin-left: 6px;"/>
							</div>
						</li>
					</div>
				</div>
			</ul>
			<ul style="padding:10px 15px; margin: 0;">
				<p style="color: red; margin: 0;">
					提示：
					</br>
					若随方医生是省外的，则使用“填写”方式，手工输入随方医生信息。
					</br>
					若随方医生是省内的，则使用“选择”方式，选择对应医院和随方医生。
				</p>
			</ul>
			<div onclick="submit()" class="submit" >提交</div>
		</div>
		<script src="../../js/mui.js"></script>
		<script src="../../js/mui.picker.min.js"></script>
		<script src="../../js/jquery.min-1.11.1.js"></script>
		<script src="../../js/request.js"></script>
		<script type="text/javascript">
			var resultall = {"r1":[{value:'0',text:' '},{value:'612',text:'城镇'},{value:'613',text:'农村'}],
			 				"r2":[{value:'0',text:' '},{value:'614',text:'在岗工人'},{value:'615',text:'在岗管理者'},{value:'616',text:'农民'},{value:'617',text:'下岗或无业'},{value:'618',text:'在校学生'},{value:'619',text:'退休'},{value:'620',text:'专业技术人员'},{value:'111',text:'其他'},{value:'243',text:'不详'}],
			 				"r4":[{value:'0',text:' '},{value:'25',text:'未治'},{value:'26',text:'间断门诊治疗'},{value:'27',text:'持续门诊治疗'}],
			 				"r5":[{value:'0',text:' '},{value:'28',text:'痊愈'},{value:'29',text:'好转'},{value:'30',text:'无变化'},{value:'31',text:'加重'}],
			 				"r7":[{value:'0',text:' '},{value:'47',text:'无关锁'},{value:'48',text:'关锁'},{value:'49',text:'关锁以解除'}],
			 				"r8":[{value:'0',text:' '},{value:'73',text:'贫困,在当地贫困县标准以下'},{value:'74',text:'非贫困'},{value:'75',text:'不详'}],
			 				"r9":[{value:'0',text:' '},{value:'1',text:'日'},{value:'2',text:'周'},{value:'3',text:'月'},{value:'4',text:'年'}]}
			var id = 0;
			var ehrId = "";//人口表ID
			var visitFrequency = "";//随访频率
			var visitUnit = "";//随访单位
			var writeDate = "";//填表日期
			var doctorName = "";//建档医生
			var createDate = "";//建档日期
			var createUser = "";//添加人
			var modifyUser = "";//修改人
			var modifyDate = "";//修改时间
			var updateUser = "";//修改人
			var updateDate = "";//修改时间
			var enableFlag = "1";//状态
			var doctorId = "";//建档医生员工ID
			var doctorHospId = "";//责任医生归属医院ID
			var doctorHospName = "";//责任医生所属医院
			var result0,result1,result2,result3,result4,result5,result6,result7,result8,result9,result10,result11,result12;
			//获取变量
			var date1 = new Date();
			var year1=date1.getFullYear(); 
			var month1=date1.getMonth()+1;
			var day1=date1.getDate();
			var h1=date1.getHours();
			var m1=date1.getMinutes();
			var s1=date1.getSeconds();
				month1 =(month1<10 ? "0"+month1:month1); 
				day1 =(day1<10 ? "0"+day1:day1); 
				h1 =(h1<10 ? "0"+h1:h1); 
				m1 =(m1<10 ? "0"+m1:m1); 
				s1 =(s1<10 ? "0"+s1:s1);
			modifyDate = (year1.toString()+'-'+month1.toString()+'-'+day1.toString()+' '+h1.toString()+':'+m1.toString()+':'+s1.toString())
			updateDate = (year1.toString()+'-'+month1.toString()+'-'+day1.toString()+' '+h1.toString()+':'+m1.toString()+':'+s1.toString())
			createDate = (year1.toString()+'-'+month1.toString()+'-'+day1.toString()+' '+h1.toString()+':'+m1.toString()+':'+s1.toString());
			var self = localStorage.getItem("name")
			var data = JSON.parse(self)
			console.log(data)
			doctorName = data.obj.userName;//责任(评估)医生名字
			doctorId = data.obj.id;//责任(评估)医生id
			doctorHospId = data.obj.hospId;//责任(评估)医生医院id
			createHospId = data.obj.hospId;//创建医院id
			doctorHospName = data.obj.hospName;//责任(评估)医生医院名称
			createUser = data.obj.id;//创建人id
			modifyUser = data.obj.id;//修改人id
			updateUser = data.obj.id;//修改人id
			var listdata = "";
			var selfdata = "";
			var dated;
			var dateov;
			var newdate = new Date();
			mui.plusReady(function(){
				var self = plus.webview.currentWebview()
					listdata = self.data
					selfdata = JSON.parse(listdata)
					console.log(JSON.stringify(selfdata))
					//赋值
					ehrId = selfdata.ehrId
					
				document.getElementById("name-1").value = selfdata.name;
				document.getElementById("sex-1").value = selfdata.sex;
				document.getElementById("age-1").value = self.age;
				document.getElementById("ad-1").value = selfdata.homeAddress;
				
				mui.ajax(getRequestUrl.url+'/mobile/ehr/psychosis/getEhrPsychosisList',{
					data:{
						"ehr_id":ehrId
					},
					dataType:'json',//服务器返回json格式数据
					type:'post',//HTTP请求类型
					timeout:10000,//超时时间设置为10秒；
					success:function(data){
						var rows = data.rows[0];
							console.log(rows)
						if (data.status == 1) {
							id = rows.id;
							$("#visitFrequency")[0].value = rows.visitFrequency;//随访频率
							var rowsresult12=resultall.r9;//随访单位
							for (var j=0; j<rowsresult12.length; j++) {
								if(rows.visitUnit == rowsresult12[j].value){
									document.getElementById("result12").value = rowsresult12[j].text;
								}
							}
							if(rows.writeDate != ""){//填表日期
								var datev = new Date(rows.writeDate);
								var yearv=datev.getFullYear(); 
								var monthv=datev.getMonth()+1;
								var dayv=datev.getDate();
									monthv =(monthv<10 ? "0"+monthv:monthv); 
									dayv =(dayv<10 ? "0"+dayv:dayv); 
								var datab = (yearv.toString()+'-'+monthv.toString()+'-'+dayv.toString());
								document.getElementById("result13").value = datab;
							}else{
								document.getElementById("result13").value = "";
							}
							$("#result14")[0].value = rows.doctorName;//建档医生
							createDate = rows.createDate;//建档日期
							createUser = rows.createUser;//添加人
							modifyUser = rows.modifyUser;//修改人
							modifyDate = rows.modifyDate;//修改时间
							doctorId = rows.doctorId;//建档医生员工ID
							doctorHospId = rows.doctorHospId;//责任医生归属医院ID
							doctorHospName = rows.doctorHospName;//责任医生所属医院
						} else {
							
						}
					},
					error:function(xhr,type,errorThrown){
						
					}
				});	
				mui.ajax(getRequestUrl.url+'/mobile/ehr/psychosisAnswer/getVisitDetail',{
					data:{
						"ehr_id":ehrId
					},
					dataType:'json',//服务器返回json格式数据
					type:'post',//HTTP请求类型
					timeout:10000,//超时时间设置为10秒；
					success:function(data){
						var rowss = data.rows;
							alert("获取成功");
							console.log(JSON.stringify(rowss[14]));
						if (data.status == 1) {
							for(var i=0; i<rowss.length; i++){
								if(rowss[i].questionId == "2"){
									document.getElementById("hz_name").value = rowss[i].answer;
								}
								if(rowss[i].questionId == "3"){
									document.getElementById("Relationship").value = rowss[i].answer;
								}
								if(rowss[i].questionId == "4"){
									document.getElementById("address").value = rowss[i].answer;
								}
								if(rowss[i].questionId == "5"){
									document.getElementById("guardian_tel").value = rowss[i].answer;
								}
								if(rowss[i].questionId == "6"){
									document.getElementById("Seat_contact").value = rowss[i].answer;
								}
								if(rowss[i].questionId == "7"){
									document.getElementById("phone").value = rowss[i].answer;
								}
								if(rowss[i].questionId == "738"){//户别
									var rowsresult0=resultall.r1;
									for (var j=0; j<rowsresult0.length; j++) {
										if(rowss[i].answerId == rowsresult0[j].value){
											document.getElementById("result0").value = rowsresult0[j].text;
										}
									}
								}
								if(rowss[i].questionId == "739"){//就业情况
									var rowsresult1=resultall.r2;
									for (var j=0; j<rowsresult1.length; j++) {
										if(rowss[i].answerId == rowsresult1[j].value){
											document.getElementById("result1").value = rowsresult1[j].text;
										}
									}
								}
								if(rowss[i].questionId == "80"){//知情同意
									if(rowss[i].answerId == "72"){
										document.getElementById("qianzhi").style.display = "none";
										document.getElementById("mySwitch1").classList.add('mui-active');
										
									}else{
										document.getElementById("qianzhi").style.display = "block";
										document.getElementById("mySwitch1").classList.remove('mui-active');
									}
								}
								if(rowss[i].questionId == "81"){//签字
									document.getElementById("qianzhi_t").value = rowss[i].answer;
								}
								if(rowss[i].questionId == "82"){//签字时间
									if(rowss[i].answer != ""){
										var datev = new Date(rowss[i].answer);
										var yearv=datev.getFullYear(); 
										var monthv=datev.getMonth()+1;
										var dayv=datev.getDate();
											monthv =(monthv<10 ? "0"+monthv:monthv); 
											dayv =(dayv<10 ? "0"+dayv:dayv); 
										var datab = (yearv.toString()+'-'+monthv.toString()+'-'+dayv.toString());
										document.getElementById("result3").value = datab;
									}else{
										document.getElementById("result3").value = "";
									}
								}
								if(rowss[i].questionId == "11"){//首次发病时间
									if(rowss[i].answer != ""){
										var datev = new Date(rowss[i].answer);
										var yearv=datev.getFullYear(); 
										var monthv=datev.getMonth()+1;
										var dayv=datev.getDate();
											monthv =(monthv<10 ? "0"+monthv:monthv); 
											dayv =(dayv<10 ? "0"+dayv:dayv); 
										var datab = (yearv.toString()+'-'+monthv.toString()+'-'+dayv.toString());
										document.getElementById("result4").value = datab;
									}else{
										document.getElementById("result4").value = "";
									}
								}
								if(rowss[i].questionId == "12"){//症状
									if(rowss[i].answer != ""){
										var my_medicineYnarr = rowss[i].answer;
										if(my_medicineYnarr != null){
											var my_medicineYnarr_n = my_medicineYnarr.split(",");
											if(my_medicineYnarr_n.length != 0){
												$ ("#ularry").each (function (){
													$ (this).find ('li').each (function (){
														var y = my_medicineYnarr_n.length-1;
														for (var i=0; i<my_medicineYnarr_n.length; i++) {
															if ($(this).val() == my_medicineYnarr_n[i]) {
										                        $(this).addClass("on");
																if(my_medicineYnarr_n[y] == "482"){
																	document.getElementById("other12_op").style.display="block";
																}else{
																	document.getElementById("other12_op").style.display="none";
																}
										                    }		
														}
													})
												})	
											}
										}
									}
								}
								if(rowss[i].questionId == "13"){//其它症状
									document.getElementById("other12_text").value = rowss[i].answer;
								}
								if(rowss[i].questionId == "17"){//即往治疗情况门诊
									var rowsresult5=resultall.r4;
									for (var j=0; j<rowsresult5.length; j++) {
										if(rowss[i].answerId == rowsresult5[j].value){
											document.getElementById("result5").value = rowsresult5[j].text;
										}
										if(rowss[i].answerId == "26" || rowss[i].answerId == "27"){
											document.getElementById("zhiliao").style.display = "block";
										}else{
											document.getElementById("zhiliao").style.display = "none";
										}
									}
								}
								if(rowss[i].questionId == "83"){//即往治疗情况门诊首次时间
									if(rowss[i].answer != ""){
										var datev = new Date(rowss[i].answer);
										var yearv=datev.getFullYear(); 
										var monthv=datev.getMonth()+1;
										var dayv=datev.getDate();
											monthv =(monthv<10 ? "0"+monthv:monthv); 
											dayv =(dayv<10 ? "0"+dayv:dayv); 
										var datab = (yearv.toString()+'-'+monthv.toString()+'-'+dayv.toString());
										document.getElementById("result6").value = datab;
									}else{
										document.getElementById("result6").value = "";
									}
								}
								if(rowss[i].questionId == "24"){//即往治疗情况住院
									document.getElementById("in_hosp").value = rowss[i].answer;
								}
								if(rowss[i].questionId == "25"){//目前诊断情况诊断
									document.getElementById("diagnosis").value = rowss[i].answer;
								}
								if(rowss[i].questionId == "26"){//目前诊断情况确认医院
									document.getElementById("hosp").value = rowss[i].answer;
								}
								if(rowss[i].questionId == "27"){//目前诊断情况确认时间
									if(rowss[i].answer != ""){
										var datev = new Date(rowss[i].answer);
										var yearv=datev.getFullYear(); 
										var monthv=datev.getMonth()+1;
										var dayv=datev.getDate();
											monthv =(monthv<10 ? "0"+monthv:monthv); 
											dayv =(dayv<10 ? "0"+dayv:dayv); 
										var datab = (yearv.toString()+'-'+monthv.toString()+'-'+dayv.toString());
										document.getElementById("result7").value = datab;
									}else{
										document.getElementById("result7").value = "";
									}
								}
								if(rowss[i].questionId == "19"){//最近一次治疗效果
									var rowsresult8=resultall.r5;
									for (var j=0; j<rowsresult8.length; j++) {
										if(rowss[i].answerId == rowsresult8[j].value){
											document.getElementById("result8").value = rowsresult8[j].text;
										}
									}
								}
								if(rowss[i].questionId == "91"){//危险行为
									if(rowss[i].answerId != "2"){
										document.getElementById("tigshow").style.display = "block";
										document.getElementById("mySwitch2").classList.add('mui-active');
										
									}else{
										document.getElementById("tigshow").style.display = "none";
										document.getElementById("mySwitch2").classList.remove('mui-active');
									}
								}
								if(rowss[i].questionId == "35"){//危险行为1
									document.getElementById("dangerous1").value = rowss[i].answer;
								}
								if(rowss[i].questionId == "36"){//危险行为2
									document.getElementById("dangerous2").value = rowss[i].answer;
								}
								if(rowss[i].questionId == "37"){//危险行为3
									document.getElementById("dangerous3").value = rowss[i].answer;
								}
								if(rowss[i].questionId == "753"){//危险行为4
									document.getElementById("dangerous4").value = rowss[i].answer;
								}
								if(rowss[i].questionId == "38"){//危险行为5
									document.getElementById("dangerous5").value = rowss[i].answer;
								}
								if(rowss[i].questionId == "39"){//危险行为6
									document.getElementById("dangerous6").value = rowss[i].answer;
								}
								if(rowss[i].questionId == "40"){//关锁情况
									var rowsresult10=resultall.r7;
									for (var j=0; j<rowsresult10.length; j++) {
										if(rowss[i].answerId == rowsresult10[j].value){
											document.getElementById("result10").value = rowsresult10[j].text;
										}
									}
								}
								if(rowss[i].questionId == "84"){//经济情况
									var rowsresult11=resultall.r8;
									for (var j=0; j<rowsresult11.length; j++) {
										if(rowss[i].answerId == rowsresult11[j].value){
											document.getElementById("result11").value = rowsresult11[j].text;
										}
									}
								}
								if(rowss[i].questionId == "85"){//专科医生的意见
									document.getElementById("opinion").value = rowss[j].answer;
								}
							}
						} else {
							
						}
					},
					error:function(xhr,type,errorThrown){
						
					}
				});	
			});	
			//内容字段部分
			mui.init()
				(function($) {
				$.init();
				var result = $('#result')[0];
				var btns = $('.btn');
				btns.each(function(i, btn) {
					btn.addEventListener('tap', function() {
						var _self = this;
						if(_self.picker) {
							_self.picker.show(function (rs) {
								result.innerText = rs.text;
								_self.picker.dispose();
								_self.picker = null;
							});
						} else {
							if(i == 0){
								var picker = new mui.PopPicker();
								picker.setData([{value:'0',text:' '},{value:'612',text:'城镇'},{value:'613',text:'农村'}]);
								picker.show(function (selectItems) {
									$('#result'+i)[0].value = selectItems[0].text;
								})
							}else if(i == 1){
								var picker = new mui.PopPicker();
								picker.setData([{value:'0',text:' '},{value:'614',text:'在岗工人'},{value:'615',text:'在岗管理者'},{value:'616',text:'农民'},{value:'617',text:'下岗或无业'},{value:'618',text:'在校学生'},{value:'619',text:'退休'},{value:'620',text:'专业技术人员'},{value:'111',text:'其他'},{value:'243',text:'不详'}]);
								picker.show(function (selectItems) {
									$('#result'+i)[0].value = selectItems[0].text;
								})
							}else if(i == 2){
								var optionsJson = this.getAttribute('data-options') || '{}';
								var options = JSON.parse(optionsJson);
								var id = this.getAttribute('id');
								_self.picker = new $.DtPicker(options);
								_self.picker.show(function(rs) {
								console.log(rs)
									$('#result3')[0].value = rs.text;
									_self.picker.dispose();
									_self.picker = null;
								});
								console.log(options)
								console.log(optionsJson)
							}else if(i == 3){
								var optionsJson = this.getAttribute('data-options') || '{}';
								var options = JSON.parse(optionsJson);
								var id = this.getAttribute('id');
								_self.picker = new $.DtPicker(options);
								_self.picker.show(function(rs) {
									$('#result4')[0].value = rs.text;
									_self.picker.dispose();
									_self.picker = null;
								});
							}else if(i == 4){
								var picker = new mui.PopPicker();
								picker.setData([{value:'0',text:' '},{value:'25',text:'未治'},{value:'26',text:'间断门诊治疗'},{value:'27',text:'持续门诊治疗'}]);
								picker.show(function (selectItems) {
									$('#result5')[0].value = selectItems[0].text;
									if(selectItems[0].value == "25"){
										document.getElementById("zhiliao").style.display = "none";
										$("#result6")[0].value ="";
									}else{
									 	document.getElementById("zhiliao").style.display = "block";
									}
								})
							}else if(i == 5){
								var optionsJson = this.getAttribute('data-options') || '{}';
								var options = JSON.parse(optionsJson);
								var id = this.getAttribute('id');
								_self.picker = new $.DtPicker(options);
								_self.picker.show(function(rs) {
									$('#result6')[0].value = rs.text;
									_self.picker.dispose();
									_self.picker = null;
								});
							}else if(i == 6){
								var optionsJson = this.getAttribute('data-options') || '{}';
								var options = JSON.parse(optionsJson);
								var id = this.getAttribute('id');
								_self.picker = new $.DtPicker(options);
								_self.picker.show(function(rs) {
									$('#result7')[0].value = rs.text;
									_self.picker.dispose();
									_self.picker = null;
								});
							}else if(i == 7){
								var picker = new mui.PopPicker();
								picker.setData([{value:'0',text:' '},{value:'28',text:'痊愈'},{value:'29',text:'好转'},{value:'30',text:'无变化'},{value:'31',text:'加重'}]);
								picker.show(function (selectItems) {
									$('#result8')[0].value = selectItems[0].text;
								})
							}else if(i == 8){
								var picker = new mui.PopPicker();
								 picker.setData([{value:'0',text:' '},{value:'47',text:'无关锁'},{value:'48',text:'关锁'},{value:'49',text:'关锁以解除'}]);
								 picker.show(function (selectItems) {
									 $('#result10')[0].value = selectItems[0].text;
								  })
							}else if(i == 9){
								var picker = new mui.PopPicker();
								 picker.setData([{value:'0',text:' '},{value:'73',text:'贫困,在当地贫困县标准以下'},{value:'74',text:'非贫困'},{value:'75',text:'不详'}]);
								 picker.show(function (selectItems) {
									 $('#result11')[0].value = selectItems[0].text;
								  })
							}else if(i == 10){
								var picker = new mui.PopPicker();
								 picker.setData([{value:'0',text:' '},{value:'1',text:'日'},{value:'2',text:'周'},{value:'3',text:'月'},{value:'4',text:'年'}]);
								 picker.show(function (selectItems) {
									 $('#result12')[0].value = selectItems[0].text;
								  })
							}else if(i == 12){//医生签字
								var picker = new mui.PopPicker();
								 picker.setData([{value:data.obj.id,text:data.obj.userName}]);
								 picker.show(function (selectItems) {
									 $('#result14')[0].value = selectItems[0].text;
								  })
							}else{
								var optionsJson = this.getAttribute('data-options') || '{}';
								var options = JSON.parse(optionsJson);
								var id = this.getAttribute('id');
								/*
								 * 首次显示时实例化组件
								 * 示例为了简洁，将 options 放在了按钮的 dom 上
								 * 也可以直接通过代码声明 optinos 用于实例化 DtPicker
								 */
								_self.picker = new $.DtPicker(options);
								_self.picker.show(function(rs) {
									/*
									 * rs.value 拼合后的 value
									 * rs.text 拼合后的 text
									 * rs.y 年，可以通过 rs.y.vaue 和 rs.y.text 获取值和文本
									 * rs.m 月，用法同年
									 * rs.d 日，用法同年
									 * rs.h 时，用法同年
									 * rs.i 分（minutes 的第二个字母），用法同年
									 */
									$('#result'+i)[0].value = rs.text;
									/* 
									 * 返回 false 可以阻止选择框的关闭
									 * return false;
									 */
									/*
									 * 释放组件资源，释放后将将不能再操作组件
									 * 通常情况下，不需要示放组件，new DtPicker(options) 后，可以一直使用。
									 * 当前示例，因为内容较多，如不进行资原释放，在某些设备上会较慢。
									 * 所以每次用完便立即调用 dispose 进行释放，下次用时再创建新实例。
									 */
									_self.picker.dispose();
									_self.picker = null;
								});
							}
						}
					}, false);
				});
			})(mui);
			var my_medicineYn = "";
			var my_medicineYn1 = "71";
			var my_medicineYn2 = "2";
			//切换1
			document.getElementById("mySwitch1").addEventListener("toggle",function(event){
				if(event.detail.isActive){
					document.getElementById("qianzhi").style.display="none";
					my_medicineYn1 = "72";
					$("#qianzhi_t").val("");
					$("#result3").val("");
				}else{
					document.getElementById("qianzhi").style.display="block";
					my_medicineYn1 = "71";
				}
			})
			//切换2
			document.getElementById("mySwitch2").addEventListener("toggle",function(event){
				if(event.detail.isActive){
					document.getElementById("tigshow").style.display="block";
					my_medicineYn1 = "1";
				}else{
					document.getElementById("tigshow").style.display="none";
					my_medicineYn1 = "2";
					$("#tigshow input").val("");
				}
			})
			//切换
			document.getElementById("mySwitch3").addEventListener("toggle",function(event){
				if(event.detail.isActive){
					document.getElementById("tigshow_doc_1").style.display="none";
					document.getElementById("tigshow_doc_2").style.display="block";
					doctorHospId = "0";//签名医生医院id
					doctorHospName = document.getElementById("text-hosp").value;//签名医生医院名字
					doctorId = "0";//签名医生id
					doctorName = document.getElementById("text-doc").value;//签名医生姓名
				}else{
					document.getElementById("tigshow_doc_1").style.display="block";
					document.getElementById("tigshow_doc_2").style.display="none";
					if(doctorId == ""){
						doctorHospId = "";//签名医生医院id
						doctorHospName = "";//签名医生医院名字
						doctorId = "";//签名医生id
						doctorName = "";//签名医生姓名
					}
				}
			})
			//复选框事件
			mui('.mui-ul-check').on('tap', 'li', function(e) {
				var index = this.getAttribute('value');
				if(!this.getAttribute('class')){
					this.classList.add('on')
					if($("#other12").hasClass('on')){
						$("#other12_op").css("display","block");
					}else{
						$("#other12_op").css("display","none");
						$("#other12_text").val("");
					}
				}else{
					this.classList.remove('on');
					if($("#other12").hasClass('on')){
						$("#other12_op").css("display","block");
					}else{
						$("#other12_op").css("display","none");
						$("#other12_text").val("");
					}
				}
			});
			//提交
			function submit(){
				//症状
				$ ("#ularry").find ('.on').each (function (){
					if($(this).length != 0){
						my_medicineYn += $(this).val() + ",";	
					}
				});
				//去掉最后一个逗号(如果不需要去掉，就不用写)
				if (my_medicineYn.length > 0) {
					my_medicineYn = my_medicineYn.substr(0,my_medicineYn.length - 1);
				}else{
					my_medicineYn = "";
				}
				//切换1
				if ($("#mySwitch1").hasClass("mui-active")) {
					my_medicineYn1 = "72";
				}else{
					my_medicineYn1 = "71";
				}
				//切换2
				if ($("#mySwitch2").hasClass("mui-active")) {
					my_medicineYn2 = "1";
				}else{
					my_medicineYn2 = "2";
				}
				var result0_arr = $('#result0')[0].value;
				for(var re=0; re<resultall.r1.length; re++){
					if(result0_arr == resultall.r1[re].text){
						result0 = resultall.r1[re].value;//户别
					};
				};
				var result1_arr = $('#result1')[0].value;
				for(var re=0; re<resultall.r2.length; re++){
					if(result1_arr == resultall.r2[re].text){
						result1 = resultall.r2[re].value;//就业情况
					};
				};
				if($("#result3")[0].value != ""){
					result3 = $("#result3")[0].value+" 00:00:00";
				}else{
					result3 = "";
				}
				if($("#result4")[0].value != ""){
					result4 = $("#result4")[0].value+" 00:00:00";
				}else{
					result4 = "";
				}
				var result5_arr = $('#result5')[0].value;
				for(var re=0; re<resultall.r4.length; re++){
					if(result5_arr == resultall.r4[re].text){
						result5 = resultall.r4[re].value;//门诊
					};
				};
				if($("#result6")[0].value != ""){
					result6 = $("#result6")[0].value+" 00:00:00";
				}else{
					result6 = "";
				}
				if($("#result7")[0].value != ""){
					result7 = $("#result7")[0].value+" 00:00:00";
				}else{
					result7 = "";
				}
				var result8_arr = $('#result8')[0].value;
				for(var re=0; re<resultall.r5.length; re++){
					if(result8_arr == resultall.r5[re].text){
						result8 = resultall.r5[re].value;//最后一次治疗效果
					};
				};
				var result10_arr = $('#result10')[0].value;
				for(var re=0; re<resultall.r7.length; re++){
					if(result10_arr == resultall.r7[re].text){
						result10 = resultall.r7[re].value;//关锁情况
					};
				};
				var result11_arr = $('#result11')[0].value;
				for(var re=0; re<resultall.r8.length; re++){
					if(result11_arr == resultall.r8[re].text){
						result11 = resultall.r8[re].value;//经济状况
					};
				};
				var result12_arr = $('#result12')[0].value;
				for(var re=0; re<resultall.r9.length; re++){
					if(result12_arr == resultall.r9[re].text){
						result12 = resultall.r9[re].value;//随访频率单位
					};
				};
				if($("#result13")[0].value != ""){
					writeDate = $("#result13")[0].value+" 00:00:00";
				}else{
					writeDate = "";
				}
				var data_object =[
					//患者监护人姓名
					{questionId:"2",
					answerId:"0",
					answer:$('#hz_name').val()},
					//与患者关系
					{questionId:"3",
					answerId:"0",
					answer:$('#Relationship').val()},
					//监护人地址
					{questionId:"4",
					answerId:"0",
					answer:$('#address').val()},
					//监护人电话
					{questionId:"5",
					answerId:"0",
					answer:$('#guardian_tel').val()},
					//辖区村(居)委会联系人
					{questionId:"6",
					answerId:"0",
					answer:$('#Seat_contact').val()},
					//联系电话
					{questionId:"7",
					answerId:"0",
					answer:$('#phone').val()},
					//户别
					{questionId:"738",
					answerId:result0,
					answer:null},
					//就业情况
					{questionId:"739",
					answerId:result1,
					answer:null},
					//知情同意
					{questionId:"80",
					answerId:my_medicineYn1,
					answer:null},
					//签字
					{questionId:"81",
					answerId:"0",
					answer:$('#qianzhi_t').val()},
					//签字时间
					{questionId:"82",
					answerId:"0",
					answer:result3},
					//首次发病时间
					{questionId:"11",
					answerId:"0",
					answer:result4},
					//即往主要症状
					{questionId:"12",
					answerId:"0",
					answer:my_medicineYn},
					//其它症状
					{questionId:"13",
					answerId:"0",
					answer:$('#other12_text').val()},
					//即往治疗情况 门诊
					{questionId:"17",
					answerId:result5,
					answer:null},
					//即往治疗情况 门诊 首次时间
					{questionId:"83",
					answerId:"0",
					answer:result6},
					//即往治疗情况 住院
					{questionId:"24",
					answerId:"0",
					answer:$('#in_hosp').val()},
					//目前诊断情况 诊断
					{questionId:"25",
					answerId:"0",
					answer:$('#diagnosis').val()},
					//目前诊断情况 确认医院
					{questionId:"26",
					answerId:"0",
					answer:$('#hosp').val()},
					//目前诊断情况 确认时间
					{questionId:"27",
					answerId:"0",
					answer:result7},
					//最近一次治疗效果
					{questionId:"19",
					answerId:result8,
					answer:null},
					//危险行为
					{questionId:"91",
					answerId:my_medicineYn2,
					answer:null},
					//危险行为1
					{questionId:"35",
					answerId:"0",
					answer:$('#dangerous1').val()},
					//危险行为2
					{questionId:"36",
					answerId:"0",
					answer:$('#dangerous2').val()},
					//危险行为3
					{questionId:"37",
					answerId:"0",
					answer:$('#dangerous3').val()},
					//危险行为4
					{questionId:"753",
					answerId:"0",
					answer:$('#dangerous4').val()},
					//危险行为5
					{questionId:"38",
					answerId:"0",
					answer:$('#dangerous5').val()},
					//危险行为6
					{questionId:"39",
					answerId:"0",
					answer:$('#dangerous6').val()},
					//关锁情况
					{questionId:"40",
					answerId:result10,
					answer:null},
					//经济情况
					{questionId:"84",
					answerId:result11,
					answer:null},
					//专科医生的意见(如果有请记录)
					{questionId:"85",
					answerId:"0",
					answer:$('#opinion').val()}
				]
				for(var i=0; i<data_object.length; i++){
					data_object[i].ehrId = ehrId;
					data_object[i].createDate = createDate;
					data_object[i].createUser = createUser;
					data_object[i].updateDate = updateDate;
					data_object[i].updateUser = updateUser;
				}
				/* var abc = {
						id : id,
						ehrId : ehrId,
						visitFrequency : $("#visitFrequency").val(),
						visitUnit : result12,
						writeDate : writeDate,
						doctorName : doctorName,
						createDate : createDate,
						createUser : createUser,
						modifyUser : modifyUser,
						modifyDate : modifyDate,
						enableFlag : enableFlag,
						doctorId : doctorId,
						doctorHospId : doctorHospId,
						doctorHospName : doctorHospName
					}
					console.log(JSON.stringify(abc)) */
				$.ajax(getRequestUrl.url+"/mobile/ehr/psychosisAnswer/addOrUpdate",{
					data:JSON.stringify(data_object),
					dataType:'json',//服务器返回json格式数据
					type:'post',//HTTP请求类型
					contentType : 'application/json;charset=utf-8',
					success:function(data){
						alert("成功1");
					},
					error:function(xhr,type,errorThrown){
						
					}
				});	
				$.ajax(getRequestUrl.url+"/mobile/ehr/psychosis/addOrUpdate",{
					data:{
							id: id,
							ehrId: ehrId,
							visitFrequency: $("#visitFrequency").val(),
							visitUnit: result12,
							writeDate: writeDate,
							doctorName: doctorName,
							createDate: createDate,
							createUser: createUser,
							modifyUser: modifyUser,
							modifyDate: modifyDate,
							enableFlag: enableFlag,
							doctorId: doctorId,
							doctorHospId: doctorHospId,
							doctorHospName: doctorHospName
						},
					dataType:'json',//服务器返回json格式数据
					type:'post',//HTTP请求类型
					timeout:10000,//超时时间设置为10秒；
					success:function(data){
						alert("成功2");
					},
					error:function(xhr,type,errorThrown){
						
					}
				});
			}
		</script>
	</body>
</html>